const path = require('path')
module.exports = {
  assetsDir: 'assets',
  pages: {
    popup: {
      template: 'public/browser-extension.html',
      entry: './src/popup/main.js',
      title: 'Popup',
    },
    newtab: {
      template: 'public/newtab-base.html',
      entry: './src/newtab/main.js',
      title: 'newtab',
    },
    functionPageOnTab: {
      template: 'public/functionPageOnTab-base.html',
      entry: './src/functionPageOnTab/main.js',
      title: '独立的功能页面',
    },
  },
  lintOnSave: false,
  configureWebpack: {
    devtool: 'source-map',
    resolve: {
      alias: {
        '@': path.resolve(__dirname, 'src'),
      },
    },
  },

  pluginOptions: {
    browserExtension: {
      componentOptions: {
        background: {
          entry: 'src/background/background.js',
        },
        contentScripts: {
          entries: {
            'content-script': ['src/content-scripts/content-script.js'],
          },
        },
      },
    },
  },
}
